load("//:build_variables.bzl", "COPTS")

package(
    default_visibility = ["//:android_cuttlefish"],
)

cc_binary(
    name = "fastboot",
    srcs = [
        "bootimg_utils.cpp",
        "bootimg_utils.h",
        "constants.h",
        "diagnose_usb/diagnose_usb.cpp",
        "diagnose_usb/include/diagnose_usb.h",
        "fastboot.cpp",
        "fastboot_driver.cpp",
        "fastboot_driver.h",
        "fastboot_driver_interface.h",
        "fastboot.h",
        "filesystem.cpp",
        "filesystem.h",
        "fs.cpp",
        "fs.h",
        "libstorage_literals/storage_literals/storage_literals.h",
        "main.cpp",
        "result.h",
        "socket.cpp",
        "socket.h",
        "storage.cpp",
        "storage.h",
        "super_flash_helper.cpp",
        "super_flash_helper.h",
        "task.cpp",
        "task.h",
        "tcp.cpp",
        "tcp.h",
        "transport.h",
        "udp.cpp",
        "udp.h",
        "usb.h",
        "usb_linux.cpp",
        "util.cpp",
        "util.h",
        "vendor_boot_img_utils.cpp",
        "vendor_boot_img_utils.h",
        "version/platform_tools_version.h",
        "version/build/version.h",
    ],
    includes = [
        "diagnose_usb/include",
        "libstorage_literals",
        "version",
    ],
    local_defines = [
        "ANDROID_BASE_UNIQUE_FD_DISABLE_IMPLICIT_CONVERSION"
    ],
    copts = COPTS + [
        "-Wno-inconsistent-missing-override",
        "-Wno-module-import-in-extern-c",
    ],
    deps = [
        "@avb//:libavb",
        "@googletest//:gtest",
        "@libzip",
        "@mkbootimg//:bootimg_header",
        "@zlib",
        "//libbase",
        "//libcutils",
        "//liblp:liblp",
        "//libsparse:libsparse",
    ],
    linkopts = ["-llzma"],
    features = ["-layering_check"], # Incompatible with libzip cmake build
)
